home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Keyboard.p < prev    next >
Text File  |  1996-05-01  |  4KB  |  145 lines

  1. {
  2.      File:        Keyboard.p
  3.  
  4.      Contains:    interfaces for keyboard componets
  5.  
  6.      Version:    Technology:    
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Keyboard;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __KEYBOARD__}
  28. {$SETC __KEYBOARD__ := 1}
  29.  
  30. {$I+}
  31. {$SETC KeyboardIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __CONDITIONALMACROS__}
  35. {$I ConditionalMacros.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __EVENTS__}
  38. {$I Events.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __IOITERATOR__}
  41. {$I IOIterator.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __TIMING__}
  44. {$I Timing.p}
  45. {$ENDC}
  46.  
  47. {$PUSH}
  48. {$ALIGN MAC68K}
  49. {$LibExport+}
  50.  
  51. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  52. {  Virtual ID for a keyboard   }
  53.  
  54. TYPE
  55.     KeyboardID                            = UInt32;
  56. {  System 8.x version of of a Keymap  }
  57.     KeyboardMap                            = PACKED ARRAY [0..31] OF Byte;
  58. {  System 8.x version of a virtual key  }
  59.     VirtualKeyCode                        = UInt8;
  60. {  System 8.x definition of keyboard modifiers  }
  61.     KeyboardModifiers                    = UInt16;
  62. {  System 8.x definition of keyboard direction  }
  63.  
  64. CONST
  65.     kKeyDirectionKeyDown        = $0001;
  66.     kKeyDirectionKeyUp            = $0002;
  67.     kKeyDirectionAutoKeyDown    = $0003;
  68.  
  69.  
  70. TYPE
  71.     KeyDirection                        = INTEGER;
  72.     KeyboardDeviceMode                    = UInt32;
  73. {  Keyboard Event returned from I/O subsystem  }
  74.     LowLevelKeyEventPtr = ^LowLevelKeyEvent;
  75.     LowLevelKeyEvent = PACKED RECORD
  76.         theBoard:                KeyboardID;
  77.         theKey:                    VirtualKeyCode;
  78.         filler1:                SInt8;
  79.         direction:                KeyDirection;
  80.         modifiers:                KeyboardModifiers;
  81.         theEventTime:            AbsoluteTime;
  82.     END;
  83.  
  84.  
  85. CONST
  86.     kKeyboardHardwareTypeUnknown = 0;
  87.     kKeyboardHardwareTypeADB    = 1;
  88.     kKeyboardHardwareTypeSerial    = 2;
  89.  
  90.  
  91. TYPE
  92.     KeyboardHardwareType                = UInt32;
  93.     KeyboardIOIteratorDataPtr = ^KeyboardIOIteratorData;
  94.     KeyboardIOIteratorData = RECORD
  95.         IOCommon:                IOCommonInfo;
  96.         theType:                KeyboardHardwareType;
  97.         keycount:                UInt32;
  98.         kcapResID:                UInt32;
  99.         hasNumericKeypad:        BOOLEAN;
  100.         hasLEDFeedback:            BOOLEAN;
  101.     END;
  102.  
  103.     KeyboardDeviceRecord                = KeyboardIOIteratorData;
  104.     KeyboardDeviceRecordPtr             = ^KeyboardDeviceRecord;
  105.  
  106. CONST
  107.     kKeyboardLEDOff                = 0;
  108.     kKeyboardLEDOn                = 1;
  109.  
  110.  
  111. TYPE
  112.     KeyboardLEDState                    = BOOLEAN;
  113.  
  114. CONST
  115.     kKeyboardLEDNumLock            = 0;
  116.     kKeyboardLEDCapsLock        = 1;
  117.     kKeyboardLEDScrollLock        = 2;
  118.  
  119.  
  120. TYPE
  121.     KeyboardLEDSelector                    = INTEGER;
  122. FUNCTION GetKeyMap(theID: KeyboardID; VAR theMap: KeyboardMap): OSStatus; C;
  123. FUNCTION KeyboardIsKeyDown(theKey: ByteParameter; VAR keyState: KeyDirection; VAR modifierState: KeyboardModifiers): OSStatus; C;
  124. {  Warning: This routine is intended only for clients who need to bypass the events system altogether.  }
  125. FUNCTION GetNextLowLevelKeyEvent(VAR theKey: LowLevelKeyEvent): OSStatus; C;
  126. FUNCTION GetLastKeypressTime(VAR theTime: AbsoluteTime): OSStatus; C;
  127. FUNCTION GetKeyboardLEDStatus(theID: KeyboardID; theLight: INTEGER; VAR value: BOOLEAN): OSStatus; C;
  128. FUNCTION SetKeyboardLEDStatus(theID: KeyboardID; theLight: INTEGER; value: BOOLEAN): OSStatus; C;
  129. FUNCTION GetKeyboardDeviceMode(theID: KeyboardID; VAR theMode: KeyboardDeviceMode): OSStatus; C;
  130. FUNCTION SetKeyboardDeviceMode(theID: KeyboardID; theMode: KeyboardDeviceMode): OSStatus; C;
  131. {  Device Iteration  }
  132. FUNCTION GetKeyboardDeviceRecord(theID: KeyboardID; VAR theDeviceRecord: KeyboardDeviceRecord): OSStatus; C;
  133. FUNCTION KeyboardGetDeviceData(requestItemCount: ItemCount; VAR totalItemCount: ItemCount; VAR iteratorBuffer: KeyboardIOIteratorData): OSStatus; C;
  134. {$ENDC}
  135. {$ALIGN RESET}
  136. {$POP}
  137.  
  138. {$SETC UsingIncludes := KeyboardIncludes}
  139.  
  140. {$ENDC} {__KEYBOARD__}
  141.  
  142. {$IFC NOT UsingIncludes}
  143.  END.
  144. {$ENDC}
  145.